<?php
/**
 *
 * @author henry
 * @version 
 */
require_once 'Zend/View/Interface.php';

/**
 * GetDetailsAppoint helper
 *
 * @uses viewHelper Zend_View_Helper
 */
class Zend_View_Helper_GetDetailsAppoint {
	
	/**
	 * @var Zend_View_Interface 
	 */
	public $view;
	
	/**
	 * 
	 */
	public function getDetailsAppoint($appointID) 
	{
		$objAppDetail = new Default_Model_AppointDetails();
		$data = $objAppDetail->getDetail($appointID);
		if (!empty($data))
		{
			$str = "";
			foreach ($data as $item)
			{
				$start = new Zend_Date($item['start_time']);
				$end = new Zend_Date($item['end_time']);
				$strtmp = $appointID."-".$item['services_id']."-".$item['employee_id'];
				$str .= "<tr id='boxrow$strtmp'><td width='140px'>".$item['employee_name']."</td>
				             <td width='140px'>".$item['services_name']."</td>
				             <td>".$start->get('H:m')." to ".$end->get('H:m')."</td>
				             <td><span class='delappdetail' rel='$strtmp'>Cancel</span></td>
				         </tr>";
			}
			return $str;
		}
		return null;
	}
	
	/**
	 * Sets the view field 
	 * @param $view Zend_View_Interface
	 */
	public function setView(Zend_View_Interface $view) {
		$this->view = $view;
	}
}

